home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 028a / managr02.zip / CONFIG40.BAS < prev    next >
BASIC Source File  |  1991-12-29  |  5KB  |  226 lines

  1. start:
  2.  
  3. 'This is the routine for working with the CONFIG.SYS file in 40-column mode.
  4.  
  5. cls
  6. print "View or Change Your CONFIG.SYS File."
  7. print
  8. print
  9. print "On which drive is your CONFIG.SYS"
  10. input "file";drive$
  11.  
  12. redrive:
  13. drive$=drive$+"\"
  14. if drive$="a:\" then file1$="a:\config.sys"
  15. if drive$="A:\" then file1$="a:\config.sys"
  16. if drive$="b:\" then file1$="b:\config.sys"
  17. if drive$="B:\" then file1$="b:\config.sys"
  18. if drive$="c:\" then file1$="c:\config.sys"
  19. if drive$="C:\" then file1$="c:\config.sys"
  20. if drive$="d:\" then file1$="d:\config.sys"
  21. if drive$="D:\" then file1$="d:\config.sys"
  22. if drive$="e:\" then file1$="e:\config.sys"
  23. if drive$="E:\" then file1$="e:\config.sys"
  24. if drive$="a:\" then file2$="a:\config.bak"
  25. if drive$="A:\" then file2$="a:\config.bak"
  26. if drive$="b:\" then file2$="b:\config.bak"
  27. if drive$="B:\" then file2$="b:\config.bak"
  28. if drive$="c:\" then file2$="c:\config.bak"
  29. if drive$="C:\" then file2$="c:\config.bak"
  30. if drive$="d:\" then file2$="d:\config.bak"
  31. if drive$="D:\" then file2$="d:\config.bak"
  32. if drive$="e:\" then file2$="e:\config.bak"
  33. if drive$="E:\" then file2$="e:\config.bak"
  34.  
  35. confmenu:
  36. cls
  37. print "You have the following options:"
  38. print
  39. print
  40. print "1- Just view the CONFIG.SYS file."
  41. print
  42. print "2- Add lines to the end of your file."
  43. print
  44. print "3- Create a new CONFIG.SYS file."
  45. print
  46. print "4- Return to the Main Options Menu."
  47. print
  48. print
  49. print "Please press the number corresponding"
  50. input "to your choice, and then press Enter. ",chngview$
  51.  
  52. if chngview$="1" then
  53. cls
  54. gosub seesys
  55. goto confmenu
  56. end if
  57.  
  58. if chngview$="2" then
  59. cls
  60. gosub appendln
  61. gosub seesys
  62. goto confmenu
  63. end if
  64.  
  65. if chngview$="3" then
  66. cls
  67. goto newfilec
  68. end if
  69.  
  70. if chngview$="4" then goto finish
  71. goto confmenu
  72.  
  73.  
  74. 'This section creates a new CONFIG.SYS file.
  75.  
  76. newfilec:
  77. cls
  78. open file1$ for input as 1
  79. open file2$ for output as 2
  80. while not eof(1)
  81. line input # 1, a$
  82. print# 2, a$
  83. wend
  84. close # 1
  85. close # 2
  86. kill file1$
  87. print
  88. print
  89. print "Your CONFIG.SYS file has been changed"
  90. print "CONFIG.BAK in order to save it for"
  91. print "future use.  To use it later, your new"
  92. print "CONFIG.SYS will have to be renamed to"
  93. print "something else (for example, CONFIG.X)"
  94. print
  95. print
  96. print
  97. print "Press any key to continue. ";
  98. gosub presskey
  99.  
  100. changagn:
  101.  
  102. cls
  103. open file1$ for output as 1
  104. print "How many files do you want?"
  105. input "To quit, press Q and Enter. ",filenumb$
  106. if filenumb$="q" or filenumb$="Q" then goto restorec
  107. print# 1, "files=";filenumb$
  108. print
  109. print
  110. print
  111. input "How many buffers do you want";buffer$
  112. print# 1, "buffers=";buffer$
  113.  
  114. devcagan:
  115. print
  116. print "Which device would you like to include"
  117. input "(N for none)";device$
  118. if device$="n" or device$="N" then goto nodevice
  119. print# 1, "devices=";device$
  120. print
  121. input "Would you like to include more devices";incldmor$
  122. if incldmor$="y" or incldmor$="Y" then goto devcagan
  123.  
  124. nodevice:
  125. print
  126. print "Do you want Break on or off (if not"
  127. input "sure, type OFF)";breakyn$
  128. if breakyn$="on" or breakyn$="ON" or breakyn$="oN" or breakyn$="On" then print# 1, "break=on"
  129. close # 1
  130. gosub seesys
  131. print
  132. print
  133. print
  134. print "If this is not O.K. AND you want to go"
  135. print "back and change the file, press C and"
  136. print "then press Enter."
  137. print
  138. print "To restore your original CONFIG.SYS"
  139. print "file, press R and Enter."
  140. print
  141. print "If you're happy with it as is, type OK"
  142. input "and Enter. ",change$
  143.  
  144. okdecide:
  145. if change$="c" or change$="C" then goto changagn
  146. if change$="r" or change$="R" then goto restorec
  147. if change$="ok" or change$="OK" or change$="oK" or change$="Ok" then goto confmenu
  148. print
  149. input "You must choose between C, R, or OK. ",change$:goto okdecide
  150.  
  151. restorec:
  152. cls
  153. reset
  154. kill file1$
  155. open file2$ for input as 1
  156. open file1$ for output as 2
  157. while not eof(1)
  158. line input # 1, a$
  159. print# 2, a$
  160. wend
  161. reset
  162. print "Your original CONFIG.SYS file has been"
  163. print "restored."
  164. print
  165. print
  166. print "Press any key to continue. ";
  167. gosub presskey
  168. goto confmenu
  169.  
  170. 'This is the end of the routine for working with the CONFIG.SYS file in 40 c.
  171.  
  172.  
  173. 'Here is the routine for looking at the CONFIG.SYS file in 40-column mode.
  174.  
  175. seesys:
  176. reset
  177. cls
  178. print "Here is your file:"
  179. print
  180. open file1$ for input as 1
  181. while not eof(1)
  182. line input # 1, a$
  183. print a$
  184. wend
  185. close # 1
  186. print
  187. print
  188. print "Press any key to continue. ";
  189. gosub presskey
  190. return
  191.  
  192. 'This is the end for looking at the CONFIG.SYS file in 40-column mode.
  193.  
  194.  
  195. 'Here is the routine for adding lines to the end of CONFIG.SYS in 40-columns.
  196.  
  197. appendln:
  198. reset
  199. open file1$ for append as 1
  200.  
  201. appndagn:
  202. print
  203. input "Line to add (Q to quit)";appendln$
  204. if appendln$="q" or appendln$="Q" then close # 1:return
  205. print# 1, appendln$
  206. goto appndagn:
  207.  
  208. 'This is the end of the routine for adding lines to CONFIG.SYS in 40-columns
  209.  
  210.  
  211. 'Here is the routine for continuing when the user presses a key.
  212.  
  213. presskey:
  214. wait:
  215. a$=inkey$
  216. if a$="" then goto wait
  217. return
  218.  
  219. 'This is the end of the routine for continuing when the user presses a key.
  220.  
  221.  
  222. 'Here is the routine for ending the program.
  223.  
  224. finish:
  225. end
  226.